/*******************************************************************************
 * FILE NAME          : syslog_api_platform.c
 *
 * DESCRIPTION        : This file provides the functions handle for Linked-list
 *                      .This file contains following function definitions.
 *                      syslog_alloc()
 *                      syslog_dealloc()
 *
 * DESIGN REFERENCE   :
 *
 * STARTING VERSION:
 *
 *
 * REVISION HISTORY   :
 * Date            Author                   REASON
 * 06.08.2013    Thuan Nguyen           Creation and Coding
 * ****************************************************************************/

#include<stdio.h>
#include<stdlib.h>
#include"../h/syslog_api_platform.h"
#include"../h/logging.h"

void* syslog_alloc(U32 caller_id,U32 block_size)
{
	void *ptr = NULL;
	ptr = malloc(block_size);
	if(NULL == ptr)
	{
		SYSLOG_COMMON_ERROR_LOGGING("[Caller:%d]Allocation memory failure %d", \
				caller_id,block_size);
		exit(EXIT_FAILURE);
	}
	return ptr;
}
void syslog_dealloc(U32 caller_id,void *block_ptr)
{
	if(NULL == block_ptr)
	{
		SYSLOG_COMMON_ERROR_LOGGING("[Caller:%d]Attempt to free NULL pointer", \
				caller_id,block_ptr);
	}else{
		free(block_ptr);
		block_ptr = NULL;
	}
}

